import { Injectable } from '@angular/core';
import {ToastController} from 'ionic-angular';
import {JmessageChenyu} from "jmessage-chenyu";
import {BaseUI} from "../common/baseui";

@Injectable()
export class JiGuanService extends BaseUI{
  constructor(public jmessageChenyu:JmessageChenyu,
              public toastCtrl:ToastController) {
    super();
  }
  //注册
  register(phone,password){
    let obj ={username: phone, password: password,nickname:phone};
    return this.jmessageChenyu.register(obj);
  }


  //登录
  login(phone,password){
    let obj ={username:phone, password:password};
    return this.jmessageChenyu.login(obj);
  }

  //注销
  logout(){
    return this.jmessageChenyu.logout();
  }

  //更改个人信息
  updateMyInfo(nickname){
    let obj ={nickname:nickname};
    return this.jmessageChenyu.updateMyInfo(obj);
  }

}
